//
//  AIMarketClickView.m
//  aixianfeng
//
//  Created by betty on 16/12/23.
//  Copyright © 2016年 lijiangbo. All rights reserved.
//

#import "AIMarketClickView.h"

@interface AIMarketClickView ()

@property (weak, nonatomic) IBOutlet UILabel *countLbl;


@end

@implementation AIMarketClickView

+ (instancetype)markerClickView {
    
    return [[NSBundle mainBundle] loadNibNamed:@"AIMarketClickView" owner:nil options:nil].lastObject;
}

#pragma mark - 增加 -
- (IBAction)addCount:(id)sender {
     self.count++;
    
    _isIncrementClicked = YES;
    
    [self sendActionsForControlEvents:UIControlEventValueChanged];
}

#pragma mark - 减少 -
- (IBAction)reduceCount:(id)sender {
    self.count--;
    
    _isIncrementClicked = NO;
    
    [self sendActionsForControlEvents:UIControlEventValueChanged];
}

- (void)setCount:(NSInteger)count{
    _count = count;
    
    _reduceBtn.hidden = !count;
    _countLbl.hidden = !count;
    
    _countLbl.text = [NSString stringWithFormat:@"%ld", count];
}

@end
